<template>
	<view>
		<view class="header">
			<image src="../../../static/icons/arrl.png" mode=""@tap="back"></image>
			<text>乐居</text>
		</view>
		<view class="list">
			<view class="item" v-for="(el,index) in list" :key="index">
				<view class="left">
					<image :src="el.pic" mode=""></image>
				</view>
				<view class="right">
					<view class="top">{{el.name}}</view>
					<view class="bottom">
						<view>收藏</view>
						<view>¥ {{el.price}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		methods:{
			back() {
				uni.switchTab({
					url:"/pages/user/user"
				})
			}
		},
		onLoad() {
			var clist = uni.getStorageSync("localList")
			if (clist) {
				this.list = clist
				console.log(clist)
			} else {
				console.log("2",clist)
			}
		}
	}
</script>

<style lang="scss" scoped>
.header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #354e44;
	height: 60rpx;
	padding: 14rpx 6rpx;
	image {
		position: absolute;
		left: 4rpx;
		top: 50%;
		transform: translateY(-50%);
		width: 40rpx;
		height: 40rpx;
	}
	text {
		font-size: 32rpx;
		color: #FFFFFF;
		font-weight: bolder;
	}
}
.list {
	padding-bottom: 20rpx;
	.item {
		display: flex;
		justify-content: space-between;
		width: 630rpx;
		height: 160rpx;
		padding: 30rpx;
		margin: 20px auto;
		background-color: #FFFFFF;
		border-radius: 8rpx;
		.left {
			width: 126rpx;
			height: 160rpx;
			border-radius: 16rpx;
			overflow: hidden;
			image {
				width: 100%;
				height: 100%;
			}
		}
		.right {
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			width: 464rpx;
			height: 160rpx;
			font-size: 24rpx;
			color: #494949;
			.bottom {
				display: flex;
				justify-content: space-between;
				>view {
					&:last-child {
						font-size: 32rpx;
						color: #1c4b47;
						font-weight: 700;
					}
				}
			}
		}
	}
}
</style>
